package com.design.pattern.factory;

/**
 * @author wangyingjie
 * @date
 * @remark 子工厂(抽象工厂模式)
 */
public class OrderPizzaImpl extends OrderPizza {

    /**
     * 子类各自实现创建对象的方法
     * @param type
     * @return
     */
    @Override
    Pizza createPizza(String type) {
        Pizza pizza;
        if (type.equals("cheese")){
            pizza = new CheesePizza();
        }else {
            pizza = new PepperoniPizza();
        }
        return pizza;
    }
}
